local sk__youlong = fk.CreateSkill {

  name = "sk__youlong",

  tags = { Skill.Compulsory, },

}



sk__youlong:addEffect(fk.BeforeTurnOver, {
  name = "sk__youlong",
  mute = true,
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(sk__youlong.name) then
      return target == player and not player.faceup
    end
  end,
  on_use = function(self, event, target, player, data)
    data.prevented = true
  end,
})
sk__youlong:addEffect(fk.EventPhaseEnd, {
  mute = true,
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(sk__youlong.name) then
      return target ~= player and target.phase==Player.Finish
    end
  end,
  on_use = function(self, event, target, player, data)
    player:broadcastSkillInvoke(sk__youlong.name)
    player.room:notifySkillInvoked(player, sk__youlong.name, "special")
    player:drawCards(1, sk__youlong.name)
    player:gainAnExtraPhase(Player.Play,sk__youlong.name,true)
  end,
})

sk__youlong:addAcquireEffect(function (self, player, is_start)
  if player.faceup then
    player:turnOver()
  end
end)


return sk__youlong
